﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Modulos/ModuloPrestamo/VistaControl/MasterPagePrestamo.master" AutoEventWireup="true" CodeFile="ingresaPrestamo.aspx.cs" Inherits="Modulos_ModuloPrestamo_VistaControl_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
Módulo de Préstamos - Ingresando Préstamos
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Ingresar Préstamo</h2><br />
    <table style="width: 100%">
                <tr>
                    <td valign="top">
                        Usuario:</td>
                    <td>
                        <asp:Label ID="LabelUsuario" runat="server" Text="Usuario"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Lugar entrega / devolución:</td>
                    <td>
                        <asp:DropDownList ID="DropDownListLugarEntrega" runat="server" 
                            DataSourceID="SqlDataSource3" DataTextField="NOMBRE_LUG" 
                            DataValueField="LUG_ID">
                        </asp:DropDownList>
                        <asp:DropDownList ID="DropDownListLugarDevolucion" runat="server" 
                            DataSourceID="SqlDataSource3" DataTextField="NOMBRE_LUG" 
                            DataValueField="LUG_ID">
                        </asp:DropDownList>
                        <asp:FormView ID="FormView3" runat="server" DataKeyNames="LUG_ID" 
                            DataSourceID="SqlDataSource3">
                            <InsertItemTemplate>
                                <table frame="box" style="width: 100%">
                                    <tr>
                                        <td colspan="2">
                                            Ingresar nuevo lugar:</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Nombre:</td>
                                        <td>
                                            <asp:TextBox ID="NOMBRE_LUGTextBox" runat="server" 
                                                Text='<%# Bind("NOMBRE_LUG") %>' />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                ControlToValidate="NOMBRE_LUGTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Ubicación:</td>
                                        <td>
                                            <asp:TextBox ID="UBICACION_LUGTextBox" runat="server" 
                                                Text='<%# Bind("UBICACION_LUG") %>' />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                                ControlToValidate="UBICACION_LUGTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;</td>
                                        <td>
                                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                                OnClientClick="javascript:if(!confirm('&iquest;Confirma insertar lugar?'))return false" 
                                                CommandName="Insert" Text="Insertar" />
                                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                                CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                                        </td>
                                    </tr>
                                </table>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                    CommandName="New" Text="Nuevo" />
                            </ItemTemplate>
                            <EmptyDataTemplate>
                                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                    CommandName="New" Text="Nuevo" />
                            </EmptyDataTemplate>
                        </asp:FormView>
                        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:AppCeiiConnectionString %>" 
                            DeleteCommand="DELETE FROM [LUGAR_ENTREGA_DEVOLUCION] WHERE [LUG_ID] = @LUG_ID" 
                            InsertCommand="INSERT INTO [LUGAR_ENTREGA_DEVOLUCION] ([NOMBRE_LUG], [UBICACION_LUG]) VALUES (@NOMBRE_LUG, @UBICACION_LUG)" 
                            ProviderName="<%$ ConnectionStrings:AppCeiiConnectionString.ProviderName %>" 
                            SelectCommand="SELECT [LUG_ID], [NOMBRE_LUG], [UBICACION_LUG] FROM [LUGAR_ENTREGA_DEVOLUCION]" 
                            UpdateCommand="UPDATE [LUGAR_ENTREGA_DEVOLUCION] SET [NOMBRE_LUG] = @NOMBRE_LUG, [UBICACION_LUG] = @UBICACION_LUG WHERE [LUG_ID] = @LUG_ID">
                            <DeleteParameters>
                                <asp:Parameter Name="LUG_ID" Type="Decimal" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="NOMBRE_LUG" Type="String" />
                                <asp:Parameter Name="UBICACION_LUG" Type="String" />
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="NOMBRE_LUG" Type="String" />
                                <asp:Parameter Name="UBICACION_LUG" Type="String" />
                                <asp:Parameter Name="LUG_ID" Type="Decimal" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Beneficiario:</td>
                    <td>
                        <asp:DropDownList ID="DropDownListBeneficiario" runat="server" 
                            DataSourceID="SqlDataSource1" DataTextField="RUT_BEN" 
                            DataValueField="RUT_BEN">
                        </asp:DropDownList>
                        <asp:FormView ID="FormView1" runat="server" DataKeyNames="RUT_BEN" 
                            DataSourceID="SqlDataSource1">
                            <InsertItemTemplate>
                                <table style="width: 100%" frame="box">
                                    <tr>
                                        <td colspan="2">
                                            Ingresar nuevo beneficiario:</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            RUT:</td>
                                        <td>
                                            <asp:TextBox ID="RUT_BENTextBox" runat="server" Text='<%# Bind("RUT_BEN") %>' />
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                                ControlToValidate="RUT_BENTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo numérico" ValidationExpression="\d*"></asp:RegularExpressionValidator>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                                ControlToValidate="RUT_BENTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            Nombres:</td>
                                        <td>
                                            <asp:TextBox ID="NOMBRE_BENTextBox" runat="server" 
                                                Text='<%# Bind("NOMBRE_BEN") %>' />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                                ControlToValidate="NOMBRE_BENTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Ap. Paterno:</td>
                                        <td>
                                            <asp:TextBox ID="AP_PATERNO_BENTextBox" runat="server" 
                                                Text='<%# Bind("AP_PATERNO_BEN") %>' />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                                ControlToValidate="AP_PATERNO_BENTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Ap. Materno:</td>
                                        <td>
                                            <asp:TextBox ID="AP_MATERNO_BENTextBox" runat="server" 
                                                Text='<%# Bind("AP_MATERNO_BEN") %>' />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                                ControlToValidate="AP_PATERNO_BENTextBox" Display="Dynamic" 
                                                ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            Institución:</td>
                                        <td>
                                            <asp:DropDownList ID="DropDownList2" runat="server" 
                                                DataSourceID="SqlDataSource2" DataTextField="NOMBRE_INST" 
                                                SelectedValue='<%# Bind("INST_ID") %>'
                                                DataValueField="INST_ID">
                                            </asp:DropDownList>
                                            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:AppCeiiConnectionString %>" 
                                                DeleteCommand="DELETE FROM [INSTITUCION] WHERE [INST_ID] = @INST_ID" 
                                                InsertCommand="INSERT INTO [INSTITUCION] ([NOMBRE_INST], [FONO_INST], [MAIL_INST]) VALUES (@NOMBRE_INST, @FONO_INST, @MAIL_INST)" 
                                                ProviderName="<%$ ConnectionStrings:AppCeiiConnectionString.ProviderName %>" 
                                                SelectCommand="SELECT [INST_ID], [NOMBRE_INST], [FONO_INST], [MAIL_INST] FROM [INSTITUCION]" 
                                                UpdateCommand="UPDATE [INSTITUCION] SET [NOMBRE_INST] = @NOMBRE_INST, [FONO_INST] = @FONO_INST, [MAIL_INST] = @MAIL_INST WHERE [INST_ID] = @INST_ID">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="INST_ID" Type="Decimal" />
                                                </DeleteParameters>
                                                <InsertParameters>
                                                    <asp:Parameter Name="NOMBRE_INST" Type="String" />
                                                    <asp:Parameter Name="FONO_INST" Type="String" />
                                                    <asp:Parameter Name="MAIL_INST" Type="String" />
                                                </InsertParameters>
                                                <UpdateParameters>
                                                    <asp:Parameter Name="NOMBRE_INST" Type="String" />
                                                    <asp:Parameter Name="FONO_INST" Type="String" />
                                                    <asp:Parameter Name="MAIL_INST" Type="String" />
                                                    <asp:Parameter Name="INST_ID" Type="Decimal" />
                                                </UpdateParameters>
                                            </asp:SqlDataSource>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Teléfono:</td>
                                        <td>
                                            <asp:TextBox ID="FONO_BENTextBox" runat="server" 
                                                Text='<%# Bind("FONO_BEN") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Mail:</td>
                                        <td>
                                            <asp:TextBox ID="MAIL_BENTextBox" runat="server" 
                                                Text='<%# Bind("MAIL_BEN") %>' />
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                                                ControlToValidate="MAIL_BENTextBox" Display="Dynamic" 
                                                ErrorMessage="formato: usr@mail.net" 
                                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;</td>
                                        <td>
                                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                            OnClientClick="javascript:if(!confirm('&iquest;Confirma ingresar beneficiario?'))return false"
                                                CommandName="Insert" Text="Insertar" />
                                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"  
                                                CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                                        </td>
                                    </tr>
                                </table>
                                &nbsp;
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                    CommandName="New" Text="Nuevo" />
                            </ItemTemplate>
                            <EmptyDataTemplate>
                                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                    CommandName="New" Text="Nuevo" />
                            </EmptyDataTemplate>
                        </asp:FormView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:AppCeiiConnectionString %>" 
                            DeleteCommand="DELETE FROM [BENEFICIARIO] WHERE [RUT_BEN] = @RUT_BEN" 
                            InsertCommand="INSERT INTO [BENEFICIARIO] ([RUT_BEN], [INST_ID], [NOMBRE_BEN], [AP_PATERNO_BEN], [AP_MATERNO_BEN], [FONO_BEN], [MAIL_BEN]) VALUES (@RUT_BEN, @INST_ID, @NOMBRE_BEN, @AP_PATERNO_BEN, @AP_MATERNO_BEN, @FONO_BEN, @MAIL_BEN)" 
                            ProviderName="<%$ ConnectionStrings:AppCeiiConnectionString.ProviderName %>" 
                            SelectCommand="SELECT [RUT_BEN], [INST_ID], [NOMBRE_BEN], [AP_PATERNO_BEN], [AP_MATERNO_BEN], [FONO_BEN], [MAIL_BEN] FROM [BENEFICIARIO]" 
                            UpdateCommand="UPDATE [BENEFICIARIO] SET [INST_ID] = @INST_ID, [NOMBRE_BEN] = @NOMBRE_BEN, [AP_PATERNO_BEN] = @AP_PATERNO_BEN, [AP_MATERNO_BEN] = @AP_MATERNO_BEN, [FONO_BEN] = @FONO_BEN, [MAIL_BEN] = @MAIL_BEN WHERE [RUT_BEN] = @RUT_BEN">
                            <DeleteParameters>
                                <asp:Parameter Name="RUT_BEN" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="RUT_BEN" Type="Int32" />
                                <asp:Parameter Name="INST_ID" Type="Decimal" />
                                <asp:Parameter Name="NOMBRE_BEN" Type="String" />
                                <asp:Parameter Name="AP_PATERNO_BEN" Type="String" />
                                <asp:Parameter Name="AP_MATERNO_BEN" Type="String" />
                                <asp:Parameter Name="FONO_BEN" Type="String" />
                                <asp:Parameter Name="MAIL_BEN" Type="String" />
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="INST_ID" Type="Decimal" />
                                <asp:Parameter Name="NOMBRE_BEN" Type="String" />
                                <asp:Parameter Name="AP_PATERNO_BEN" Type="String" />
                                <asp:Parameter Name="AP_MATERNO_BEN" Type="String" />
                                <asp:Parameter Name="FONO_BEN" Type="String" />
                                <asp:Parameter Name="MAIL_BEN" Type="String" />
                                <asp:Parameter Name="RUT_BEN" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Fecha/Hora inicio:</td>
                    <td>
                        <asp:DropDownList ID="DropDownListIniHrs" runat="server">
                            <asp:ListItem>00</asp:ListItem>
                            <asp:ListItem>01</asp:ListItem>
                            <asp:ListItem>02</asp:ListItem>
                            <asp:ListItem>03</asp:ListItem>
                            <asp:ListItem>04</asp:ListItem>
                            <asp:ListItem>05</asp:ListItem>
                            <asp:ListItem>06</asp:ListItem>
                            <asp:ListItem>07</asp:ListItem>
                            <asp:ListItem>08</asp:ListItem>
                            <asp:ListItem>09</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>11</asp:ListItem>
                            <asp:ListItem>12</asp:ListItem>
                            <asp:ListItem>13</asp:ListItem>
                            <asp:ListItem>14</asp:ListItem>
                            <asp:ListItem>15</asp:ListItem>
                            <asp:ListItem>16</asp:ListItem>
                            <asp:ListItem>17</asp:ListItem>
                            <asp:ListItem>18</asp:ListItem>
                            <asp:ListItem>19</asp:ListItem>
                            <asp:ListItem>20</asp:ListItem>
                            <asp:ListItem>21</asp:ListItem>
                            <asp:ListItem>22</asp:ListItem>
                            <asp:ListItem>23</asp:ListItem>
                            <asp:ListItem>24</asp:ListItem>
                        </asp:DropDownList>
                        :
                        <asp:DropDownList ID="DropDownListIniMin" runat="server">
                            <asp:ListItem>00</asp:ListItem>
                            <asp:ListItem>01</asp:ListItem>
                            <asp:ListItem>02</asp:ListItem>
                            <asp:ListItem>03</asp:ListItem>
                            <asp:ListItem>04</asp:ListItem>
                            <asp:ListItem>05</asp:ListItem>
                            <asp:ListItem>06</asp:ListItem>
                            <asp:ListItem>07</asp:ListItem>
                            <asp:ListItem>08</asp:ListItem>
                            <asp:ListItem>09</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>11</asp:ListItem>
                            <asp:ListItem>12</asp:ListItem>
                            <asp:ListItem>13</asp:ListItem>
                            <asp:ListItem>14</asp:ListItem>
                            <asp:ListItem>15</asp:ListItem>
                            <asp:ListItem>16</asp:ListItem>
                            <asp:ListItem>17</asp:ListItem>
                            <asp:ListItem>18</asp:ListItem>
                            <asp:ListItem>19</asp:ListItem>
                            <asp:ListItem>20</asp:ListItem>
                            <asp:ListItem>21</asp:ListItem>
                            <asp:ListItem>22</asp:ListItem>
                            <asp:ListItem>23</asp:ListItem>
                            <asp:ListItem>24</asp:ListItem>
                            <asp:ListItem>25</asp:ListItem>
                            <asp:ListItem>26</asp:ListItem>
                            <asp:ListItem>27</asp:ListItem>
                            <asp:ListItem>28</asp:ListItem>
                            <asp:ListItem>29</asp:ListItem>
                            <asp:ListItem>30</asp:ListItem>
                            <asp:ListItem>31</asp:ListItem>
                            <asp:ListItem>32</asp:ListItem>
                            <asp:ListItem>33</asp:ListItem>
                            <asp:ListItem>34</asp:ListItem>
                            <asp:ListItem>35</asp:ListItem>
                            <asp:ListItem>36</asp:ListItem>
                            <asp:ListItem>37</asp:ListItem>
                            <asp:ListItem>38</asp:ListItem>
                            <asp:ListItem>39</asp:ListItem>
                            <asp:ListItem>40</asp:ListItem>
                            <asp:ListItem>41</asp:ListItem>
                            <asp:ListItem>42</asp:ListItem>
                            <asp:ListItem>43</asp:ListItem>
                            <asp:ListItem>44</asp:ListItem>
                            <asp:ListItem>45</asp:ListItem>
                            <asp:ListItem>46</asp:ListItem>
                            <asp:ListItem>47</asp:ListItem>
                            <asp:ListItem>48</asp:ListItem>
                            <asp:ListItem>49</asp:ListItem>
                            <asp:ListItem>50</asp:ListItem>
                            <asp:ListItem>51</asp:ListItem>
                            <asp:ListItem>52</asp:ListItem>
                            <asp:ListItem>53</asp:ListItem>
                            <asp:ListItem>54</asp:ListItem>
                            <asp:ListItem>55</asp:ListItem>
                            <asp:ListItem>56</asp:ListItem>
                            <asp:ListItem>57</asp:ListItem>
                            <asp:ListItem>58</asp:ListItem>
                            <asp:ListItem>59</asp:ListItem>
                        </asp:DropDownList>
                        &nbsp;hrs.
                        <asp:Calendar ID="CalendarIni" runat="server"></asp:Calendar>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Fecha/Hora término:</td>
                    <td>
                        <asp:DropDownList ID="DropDownListFinHrs" runat="server">
                            <asp:ListItem>00</asp:ListItem>
                            <asp:ListItem>01</asp:ListItem>
                            <asp:ListItem>02</asp:ListItem>
                            <asp:ListItem>03</asp:ListItem>
                            <asp:ListItem>04</asp:ListItem>
                            <asp:ListItem>05</asp:ListItem>
                            <asp:ListItem>06</asp:ListItem>
                            <asp:ListItem>07</asp:ListItem>
                            <asp:ListItem>08</asp:ListItem>
                            <asp:ListItem>09</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>11</asp:ListItem>
                            <asp:ListItem>12</asp:ListItem>
                            <asp:ListItem>13</asp:ListItem>
                            <asp:ListItem>14</asp:ListItem>
                            <asp:ListItem>15</asp:ListItem>
                            <asp:ListItem>16</asp:ListItem>
                            <asp:ListItem>17</asp:ListItem>
                            <asp:ListItem>18</asp:ListItem>
                            <asp:ListItem>19</asp:ListItem>
                            <asp:ListItem>20</asp:ListItem>
                            <asp:ListItem>21</asp:ListItem>
                            <asp:ListItem>22</asp:ListItem>
                            <asp:ListItem>23</asp:ListItem>
                            <asp:ListItem>24</asp:ListItem>
                        </asp:DropDownList>
                        :
                        <asp:DropDownList ID="DropDownListFinMin" runat="server">
                        <asp:ListItem>00</asp:ListItem>
                            <asp:ListItem>01</asp:ListItem>
                            <asp:ListItem>02</asp:ListItem>
                            <asp:ListItem>03</asp:ListItem>
                            <asp:ListItem>04</asp:ListItem>
                            <asp:ListItem>05</asp:ListItem>
                            <asp:ListItem>06</asp:ListItem>
                            <asp:ListItem>07</asp:ListItem>
                            <asp:ListItem>08</asp:ListItem>
                            <asp:ListItem>09</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>11</asp:ListItem>
                            <asp:ListItem>12</asp:ListItem>
                            <asp:ListItem>13</asp:ListItem>
                            <asp:ListItem>14</asp:ListItem>
                            <asp:ListItem>15</asp:ListItem>
                            <asp:ListItem>16</asp:ListItem>
                            <asp:ListItem>17</asp:ListItem>
                            <asp:ListItem>18</asp:ListItem>
                            <asp:ListItem>19</asp:ListItem>
                            <asp:ListItem>20</asp:ListItem>
                            <asp:ListItem>21</asp:ListItem>
                            <asp:ListItem>22</asp:ListItem>
                            <asp:ListItem>23</asp:ListItem>
                            <asp:ListItem>24</asp:ListItem>
                            <asp:ListItem>25</asp:ListItem>
                            <asp:ListItem>26</asp:ListItem>
                            <asp:ListItem>27</asp:ListItem>
                            <asp:ListItem>28</asp:ListItem>
                            <asp:ListItem>29</asp:ListItem>
                            <asp:ListItem>30</asp:ListItem>
                            <asp:ListItem>31</asp:ListItem>
                            <asp:ListItem>32</asp:ListItem>
                            <asp:ListItem>33</asp:ListItem>
                            <asp:ListItem>34</asp:ListItem>
                            <asp:ListItem>35</asp:ListItem>
                            <asp:ListItem>36</asp:ListItem>
                            <asp:ListItem>37</asp:ListItem>
                            <asp:ListItem>38</asp:ListItem>
                            <asp:ListItem>39</asp:ListItem>
                            <asp:ListItem>40</asp:ListItem>
                            <asp:ListItem>41</asp:ListItem>
                            <asp:ListItem>42</asp:ListItem>
                            <asp:ListItem>43</asp:ListItem>
                            <asp:ListItem>44</asp:ListItem>
                            <asp:ListItem>45</asp:ListItem>
                            <asp:ListItem>46</asp:ListItem>
                            <asp:ListItem>47</asp:ListItem>
                            <asp:ListItem>48</asp:ListItem>
                            <asp:ListItem>49</asp:ListItem>
                            <asp:ListItem>50</asp:ListItem>
                            <asp:ListItem>51</asp:ListItem>
                            <asp:ListItem>52</asp:ListItem>
                            <asp:ListItem>53</asp:ListItem>
                            <asp:ListItem>54</asp:ListItem>
                            <asp:ListItem>55</asp:ListItem>
                            <asp:ListItem>56</asp:ListItem>
                            <asp:ListItem>57</asp:ListItem>
                            <asp:ListItem>58</asp:ListItem>
                            <asp:ListItem>59</asp:ListItem>
                        </asp:DropDownList>
                        &nbsp;hrs.<asp:Label ID="LabelErrorFecha" runat="server" ForeColor="#FF3300" 
                            Text="* error fecha" Visible="False"></asp:Label>
&nbsp;<asp:Calendar ID="CalendarFin" runat="server"></asp:Calendar>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Materiales:</td>
                    <td>
                        <asp:LinkButton ID="LinkButtonVerPorHora" runat="server">ver</asp:LinkButton>
&nbsp;<asp:DropDownList ID="DropDownListMaterial" runat="server" 
                            DataSourceID="SqlDataSource4" DataTextField="NOMBRE_MAT_P" 
                            DataValueField="MAT_P_ID">
                        </asp:DropDownList>&nbsp;Cantidad:&nbsp;<asp:TextBox ID="TextBoxCantidad" 
                            runat="server" Width="28px"></asp:TextBox>
&nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ControlToValidate="TextBoxCantidad" Display="Dynamic" 
                            ErrorMessage="* campo numérico" ValidationExpression="\d*"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ControlToValidate="TextBoxCantidad" Display="Dynamic" 
                            ErrorMessage="* campo obligatorio"></asp:RequiredFieldValidator>
                        <asp:LinkButton ID="LinkButtonAgregarMat" runat="server" 
                            onclick="LinkButtonAgregarMat_Click">Agregar</asp:LinkButton>
                        <br />
                        <asp:ListBox ID="ListBoxMateriales" runat="server"></asp:ListBox>
                        <asp:LinkButton ID="LinkButtonEliminar" runat="server" 
                            onclick="LinkButtonEliminar_Click">Eliminar</asp:LinkButton>
&nbsp;<asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:AppCeiiConnectionString %>" 
                            DeleteCommand="DELETE FROM [MATERIAL_PRESTAMO] WHERE [MAT_P_ID] = @MAT_P_ID" 
                            InsertCommand="INSERT INTO [MATERIAL_PRESTAMO] ([NOMBRE_MAT_P], [CANTIDAD_MAT_P], [DES_MAT_P]) VALUES (@NOMBRE_MAT_P, @CANTIDAD_MAT_P, @DES_MAT_P)" 
                            ProviderName="<%$ ConnectionStrings:AppCeiiConnectionString.ProviderName %>" 
                            SelectCommand="SELECT [MAT_P_ID], [NOMBRE_MAT_P], [CANTIDAD_MAT_P], [DES_MAT_P] FROM [MATERIAL_PRESTAMO]" 
                            UpdateCommand="UPDATE [MATERIAL_PRESTAMO] SET [NOMBRE_MAT_P] = @NOMBRE_MAT_P, [CANTIDAD_MAT_P] = @CANTIDAD_MAT_P, [DES_MAT_P] = @DES_MAT_P WHERE [MAT_P_ID] = @MAT_P_ID">
                            <DeleteParameters>
                                <asp:Parameter Name="MAT_P_ID" Type="Decimal" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="NOMBRE_MAT_P" Type="String" />
                                <asp:Parameter Name="CANTIDAD_MAT_P" Type="Int32" />
                                <asp:Parameter Name="DES_MAT_P" Type="String" />
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="NOMBRE_MAT_P" Type="String" />
                                <asp:Parameter Name="CANTIDAD_MAT_P" Type="Int32" />
                                <asp:Parameter Name="DES_MAT_P" Type="String" />
                                <asp:Parameter Name="MAT_P_ID" Type="Decimal" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Comentario:</td>
                    <td>
                        <asp:TextBox ID="TextBoxComentario" runat="server" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:LinkButton ID="LinkButtonInsertarCarta" runat="server" 
                        OnClientClick="javascript:if(!confirm('Se generará la carta de préstamo y la vista previa. &iquest;Desea continuar?'))return false"
                            onclick="LinkButtonInsertarCarta_Click">Generar Préstamo</asp:LinkButton>
                        <asp:SqlDataSource ID="SqlDataSourceListaMat" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:AppCeiiConnectionString %>" 
                            ProviderName="<%$ ConnectionStrings:AppCeiiConnectionString.ProviderName %>" 
                            SelectCommand="SELECT [MAT_P_ID], [CARTA_ID], [CANT_MAT_P] FROM [LISTA_MATERIAL_PRESTAMO]"
                            InsertCommand="INSERT INTO [LISTA_MATERIAL_PRESTAMO] ([MAT_P_ID], [CARTA_ID], [CANT_MAT_P]) VALUES (@MAT_P_ID, @CARTA_ID, @CANT_MAT_P)" >
                            <InsertParameters>
                                <asp:Parameter Name="MAT_P_ID" Type="Int32"/>
                                <asp:Parameter Name="CARTA_ID" Type="Int32"/>
                                <asp:Parameter Name="CANT_MAT_P" Type="Int32"/>
                            </InsertParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
            </table>
    </asp:Content>

